<div class="modal fade" id="insert-sub-category-modal" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title"><i class="fa fa-edit"></i> New Sub Category</h4>
			</div>
			<form action="<?php echo base_url(); ?>control-settings/insert-sub-category" method="post" onsubmit="return isBlank()" name="form_change_password">
				<div class="modal-body">
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><i class="fa fa-edit"></i></span>
							<select name="category" class="form-control">
								<option value="">Select Main Category</option>
							</select>

						</div>
						<p class="help-block" id="error_category"></p>
					</div>
					<div class="form-group">
						<div class="input-group">
							<span class="input-group-addon"><i class="fa fa-edit"></i></span>
							<input name="sub_category" type="text" class="form-control" placeholder="Sub Category Name" required="required">

						</div>
						<p class="help-block" id="error_category"></p>
					</div>

				</div>
				<div class="modal-footer clearfix">

					<button type="button" class="btn btn-danger" data-dismiss="modal">
						<i class="fa fa-times"></i> Discard
					</button>

					<button type="submit" class="btn btn-primary pull-left">
						<i class="fa fa-edit"></i> Save
					</button>
				</div>
			</form>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
	function validatePassword() {
		var pass = document.forms["form_change_password"]["password"].value;
		var conf_pass = document.forms["form_change_password"]["conf_password"].value;
		var valid = true;
		if (pass == null || pass == "") {
			document.getElementById("error_pass").innerHTML = "Password field must be filled out";
			valid = false;
		} else {
			document.getElementById("error_pass").innerHTML = "";
		}
		if (conf_pass == null || conf_pass == "") {
			document.getElementById("error_conf_pass").innerHTML = "Confirm password field must be filled out";
			valid = false;
		} else {
			document.getElementById("error_conf_pass").innerHTML = "";
		}
		if (conf_pass != pass) {
			document.getElementById("error_pass").innerHTML = "Password field must matches confirm password field";
			valid = false;
		}
		//if (!valid) alert(msg);
		return valid;
	}

</script>